package com.lbjhan.rpc.pojo;

public enum SerializerOption {
    JDK("com.lbjhan.rpc.serializer.JacksonSerializer", 0),
    HESSIAN("com.lbjhan.rpc.serializer.HessianSerializer", 1),
    FASTJSON("com.lbjhan.rpc.serializer.FastjsonSerializer", 2),
    JACKSON("com.lbjhan.rpc.serializer.JacksonSerializer", 3),
    PROTOSTUFF("com.lbjhan.rpc.serializer.ProtostuffSerializer", 4),
    KRYO("com.lbjhan.rpc.serializer.KryoSerializer", 5);
    private String className;
    private int option;
    private SerializerOption(String className, int option){
        this.className = className;
        this.option = option;
    }
    public static String getClassName(int option){
        switch (option){
            case 0: return "com.lbjhan.rpc.serializer.JacksonSerializer";
            case 1: return "com.lbjhan.rpc.serializer.HessianSerializer";
            case 2: return "com.lbjhan.rpc.serializer.FastjsonSerializer";
            case 3: return "com.lbjhan.rpc.serializer.JacksonSerializer";
            case 4: return "com.lbjhan.rpc.serializer.ProtostuffSerializer";
            case 5: return "com.lbjhan.rpc.serializer.KryoSerializer";
            default: return null;
        }
    }

    public int getOption(){
        return this.option;
    }
}
